package com.java.demo.thread;

/**
 * @auther zhangwj
 * @date 2020/4/9 9:28 上午
 */
public class VolatileDemo {
    volatile static int i;

    public static void main(String[] args) {

        for ( i = 0; i < 100; i++){
            MyThread3 myThread3 = new MyThread3(i);
            myThread3.start();
        }
    }

}


class num {

    private String num;

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }
}

class MyThread3 extends Thread {

    private int i;

    MyThread3(int i){
      this.i = i;
    }

    @Override
    public void run() {
        super.run();
        System.out.println(i);
    }
}